import {alert} from "../../components/common/alert";

import {get} from "../../utils/req";

export async function list() {
    try {
        return await get('/private/student/list') || [];
    } catch (e) {
        alert(`获取学员信息失败：${e}`, 'error');
        return [];
    }
}

export async function children() {
    try {
        return await get('/private/student/children') || [];
    } catch (e) {
        alert(`获取学员信息失败：${e}`, 'error');
        return [];
    }
}

export async function ungrouped(courseId) {
    try {
        return await get(`/private/student/ungrouped?courseId=${courseId}`) || [];
    } catch (e) {
        alert(`获取学员信息失败：${e}`, 'error');
        return [];
    }
}
